<form action="<{:U('Content/sendmessage')}>" method="post" name="form" onsubmit="return checkmessage();">
	<input type="hidden" readonly name="id" value="<{$Think.get.id}>">
	<table width="100%" border="0" cellpadding="3" cellspacing="0">
		<tr>
			<td  height="30" align="right" >姓名：</td>
			<td><input name="username" type="text" id="username" value="" size="50" maxlength="10" />
			<font color="red">*</font></td>
		</tr>
		<tr>
			<td height="30" align="right" >电话：</td>
			<td><input name="tel" type="text" id="tel" value="" size="50" maxlength="20" /> 
			<font color="red">*</font></td>
		</tr>
		<tr>
			<td height="30" align="right" >邮箱：</td>
			<td><input name="email" type="text" id="email" value="" size="50" maxlength="30" /> <font color="red">*</font> 
			</td>
		</tr>
		<tr>
			<td height="30" align="right" >内容：</td>
			<td><textarea cols="80" rows="8" name="content" id="content"></textarea>
			<font color="red">*</font></td>
		</tr>     
		<tr>
			<td height="45" align="right">&nbsp;</td>
			<td><input name="Submit" type="submit" class="sub" value=" 提交 " style="padding:3px 8px;" /> <input name="" type="reset" value=" 重置 " class="reset" style="padding:3px 8px;" /></td>
		</tr>
	</table>
</form>
<script type="text/javascript">
function checkmessage(){
	var username = $("#username").val();
	var tel = $("#tel").val();
	var email = $("#email").val();
	var content = $("#content").val();
	if(username=='')
	{
		alert("请输入姓名！");
		return false;
	}
	if(tel=='')
	{
		alert("请输入手机号码！");
		return false;
	}
	else{
		var pattern = new RegExp(/^0?(13[0-9]|15[012356789]|18[0236789]|14[57])[0-9]{8}$/);
		if(!pattern.test(tel))
		{
			alert("请输入正确的手机号码！");
			return false;
		}
	}
	
  if(email=='')
	{
		alert("请输入Email地址！");
		return false;
	}
	else
	{
		var pattern = new RegExp(/^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/);
		if(!pattern.test(email))
		{
			alert("请输入正确的Email地址！");
			return false;
		}
	}

	if(content=='')
	{
		alert("请输入内容！");
		return false;
	}
	else
	{
		return true;
	}
	return false;
}
</script>